package com.example.bili.view.activity;

import android.support.v4.app.Fragment;
import android.support.v4.view.ViewPager;
import android.widget.FrameLayout;
import android.widget.ImageView;

import com.example.bili.R;
import com.example.bili.adapter.ParttionFanjuAdapter;
import com.example.bili.base.BaseActivity;
import com.example.bili.view.fragment.PartitionFanjuDomestic;
import com.example.bili.view.fragment.PartitionFanjuFinish;
import com.example.bili.view.fragment.PartitionFanjuMessage;
import com.example.bili.view.fragment.PartitionFanjuOfficial;
import com.example.bili.view.fragment.PartitionFanjuSerialize;
import com.example.bili.view.fragment.PartitionFanjuTj;
import com.flyco.tablayout.SlidingTabLayout;

import java.util.ArrayList;
import java.util.List;

public class FanJuActivity extends BaseActivity{

    private ViewPager l_partion_fanju_vp;
    private FrameLayout l_partion_fanju_leftdrawlayout_fl;
    private ImageView l_partition_fanju_back;
    private SlidingTabLayout l_partition_fanju_commontablayout;
    private List<Fragment> fanju_fragment_list;

    /**
     * 分区番剧
     */


    @Override
    protected void initview() {
        l_partion_fanju_vp = (ViewPager) findViewById(R.id.l_partion_fanju_vp);
        l_partion_fanju_leftdrawlayout_fl = (FrameLayout) findViewById(R.id.l_partion_fanju_leftdrawlayout_fl);
        l_partition_fanju_back = (ImageView) findViewById(R.id.l_partition_fanju_back);
        l_partition_fanju_commontablayout = (SlidingTabLayout) findViewById(R.id.l_partition_fanju_commontablayout);
        fanju_fragment_list = new ArrayList<>();
    }

    @Override
    public int getLayoutView() {

        return R.layout.activity_fan_ju;

    }

    @Override
    protected void m_oncreate() {
        getfragmentpage();
        l_partion_fanju_vp.setAdapter(new ParttionFanjuAdapter(getSupportFragmentManager(),fanju_fragment_list));
        l_partion_fanju_vp.setCurrentItem(1);
        l_partition_fanju_commontablayout.setViewPager(l_partion_fanju_vp,new String[]{"推荐","连载动画","完结动画","国产动画","资讯","官方延伸"});

    }

    public void getfragmentpage() {
        fanju_fragment_list.add(new PartitionFanjuTj());
        fanju_fragment_list.add(new PartitionFanjuSerialize());
        fanju_fragment_list.add(new PartitionFanjuDomestic());
        fanju_fragment_list.add(new PartitionFanjuFinish());
        fanju_fragment_list.add(new PartitionFanjuMessage());
        fanju_fragment_list.add(new PartitionFanjuOfficial());
    }
}
